<template>
    <div class="container">
        <div :class="getClass ? 'details' : 'ordinary'">
            <div class="title">{{ getTitle }}</div>
            <div class="note">{{ getNote }}</div>
        </div>
    </div>
</template>

<script>
export default {
    name: "Heading",
    computed: {
        getTitle() {
            return this.$store.state.siteInfo.title;
        },
        getNote() {
            return this.$store.state.siteInfo.note;
        },
        getClass() {
            return this.$route.name === "Details";
        }
    }
};
</script>

<style scoped>
.container {
    background: #333;
    color: #fff;
    margin: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 60px 0 120px;
}

.ordinary,
.details {
    text-align: center;
    width: 750px;
    flex-direction: column;
}
.title {
    width: 100%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow:ellipsis;
    font-size: 60px;
    font-weight: bold;
    margin-bottom: 15px;
}

.details {
    text-align: left;
}
.details .note {
    font-style: italic;
    font-family: Lora, "Times New Roman", serif;
    font-size: 20px;
}

/* 移动端 Header样式 */
@media screen and (max-width: 600px) {
    .container{
        padding: 30px 0 60px;
    }
    .title{
        font-size: 32px;
        text-align: center;
    }
    .details{
        text-align: center;
    }
}
</style>
